package hanqi.rabbit;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class Bra {
    private final RabbitTemplate rabbitTemplate;  // 用于发送消息的 RabbitTemplate
    private final static String QUEUE_NAME = "netoru";
    // 注入 RabbitTemplate
    @Autowired
    public Bra(RabbitTemplate rabbitTemplate) {
        this.rabbitTemplate = rabbitTemplate;
    }
    public void send(String message) {


        rabbitTemplate.convertAndSend(QUEUE_NAME, message);
    }
}
